package com.harry.hr.utils;

import java.util.ArrayList;
import java.util.List;

public class PageResult {
	
	private int pageNo=1;				//实际页号
	private int pageSize=3;				//每页显示多少条记录
	private int recordTotal=0;			//总记录数
	
	
	

	
	
	
	
	
	public PageResult(int pageNo, int pageSize, int recordTotal) {
		super();
		this.pageNo = pageNo;
		this.pageSize = pageSize;
		this.recordTotal = recordTotal;
	}




	public PageResult() {		
	}

	
	
	
	public int getPageNo() {
		return pageNo;
	}
	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}
	public int getPageSize() {
		return (0==pageSize)?10:pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public int getRecordTotal() {
		return recordTotal;
	}
	public void setRecordTotal(int recordTotal) {
		this.recordTotal = recordTotal;
	}
	
	public int getPageTotal(){
		int ret=(this.getRecordTotal()-1)/this.getPageSize()+1;
		ret=(ret<1)?1:ret;
		return ret;
	}
	
	public int getFirstRecord(){
		int ret=(this.getPageNo()-1)*this.getPageSize();
		ret=(ret<1)?0:ret;
		return ret;
	}







}
